package com.xianggu.designMode.decorator.demo01;

/**
 * 装饰者模式
 * @author chengjy
 * @date 2025/3/14
 */
public class DemoFastFood {
    public static void main(String[] args) {
        // 声明炒饭
        FastFood fastFood = new FriedRice();
        // 加蛋
        fastFood = new Egg(fastFood);
        System.out.println(fastFood.getDesc() + "总价格：" + fastFood.cost());

        System.out.println("----------------------" );
        fastFood = new Bacon(fastFood);
        System.out.println(fastFood.getDesc() + "总价格：" + fastFood.cost());
    }
}
